package com.uzai.common.enums.mini;

import java.util.Objects;

/**
 * The enum Mini order status.
 *
 * @author mingyang.chen create in 2023/11/1 17:09
 */
public enum MiniAddressType {

    MER(1, "运营商地址"),
    /**
     * 不展示
     */
    USER(2, "用户地址"),
    ;

    private final Integer code;
    private final String desc;

    MiniAddressType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MiniAddressType getByCode(Integer code) {
        for (MiniAddressType value : MiniAddressType.values()) {
            if (Objects.equals(value.code, code)) {
                return value;
            }
        }
        return null;
    }

    /**
     * Gets code.
     *
     * @return the code
     */
    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
